//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - EntityName
// 1 - Properties
//===================================================================================

namespace App.Domain.Handlers {
    using App.Data;
    using App.Domain.Contracts;
    using App.Domain.Models;

    public class UpdateTraining {
        private readonly ITrainingRepository _trainingRepository;

        public UpdateTraining(ITrainingRepository trainingRepository) {
            _trainingRepository = trainingRepository;
        }

        public void Execute(ICreateTrainingCommand trainingForm) {
            var training = trainingForm.ConvertToEntity();

            _trainingRepository.Update(training);
        }
    }
}
